﻿<div ng-controller="quotaRecordController">
    <div class="wrapper border-bottom white-bg page-heading">
        <div class="col-lg-pull-12">
            <ol class="breadcrumb">
                <li>购买审核</li>
            </ol>
        </div>
    </div>
    <form class="form-horizontal row">
        <div class="form-group">
            <div class="col-md-4">
                <label class="col-sm-4 control-label">名称</label>
                <div class="col-sm-7">
                    <input name="name" type="text" class="form-control input-sm" ng-model="query.name">
                </div>
            </div>
            <div class="col-sm-4">
                <label class="col-sm-4 control-label">时间</label>
                <div class="col-sm-8">
                    <div date class="input-group date">
                        <input class="form-control input-sm" ng-model="query.start_time">
                        <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <label class="col-sm-1 control-label">至</label>
                <div class="col-sm-8">
                    <div date class="input-group date">
                        <input class="form-control input-sm" ng-model="query.end_time">
                        <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                    </div>
                </div>
            </div>
          
        </div>
        <div class="form-group">
            <div class="col-sm-4">
                <label class="col-sm-4 control-label">状态</label>
                <div class="col-sm-8">
                    <div class="col-sm-12">
                        <select name="status" class="form-control input-sm" ng-model="query.equota_record_audit">
                            <option value="">请选择</option>
                            <option value="0">待审核</option>
                            <option value="1">已通过</option>
                            <option value="2">未通过</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="col-sm-offset-4 col-sm-8">
                    <button class="btn btn-primary btn-sm" ng-click="search(query)"><i class="fa fa-search"></i> 查询</button>
                </div>
            </div>
        </div>
    </form>
    <table style="table-layout:fixed;" class="table table-hover m-t-md">
        <thead>
            <tr style="background-color: #f7f7f9;">
                <th>序号</th>
                <th >姓名</th>
                <th>账号</th>
                <th>申请数量</th>
                <th>联系方式</th>
                <th>申请时间</th>
                <th>通过时间</th>
                <th>添加数量</th>
                <th >审核备注</th>
                <th>状态</th>
                <th width="65">操作</th>
            </tr>
        </thead>
        <tbody ng-repeat="item in model.rows">
            <tr>
                <td>{{$index+1}}</td>
                <td>{{item.merchant_name}}</td>
                <td >
                    {{item.account_mobile}}
                </td>
                <td>
                    {{item.apply_num}}
                </td>
                <td>
                    {{item.moblie}}
                </td>
                <td>{{item.apply_time}}</td>
                <td>
                    {{item.audit_time}}
                </td>
                <td>
                    {{item.audit_num}}
                </td>
                <td>
                    {{item.remark}}
                </td>
                <td style="{{item.equota_record_audit==1?'color:#008000':'color:#0000ff'}}">{{item.equota_record_audit_desc}} </td>
                <td>

                    <a ng-if="item.equota_record_audit==0" class="btn btn-primary btn-xs" ng-click="open_audit_action(item)"><i class="fa fa-cog"></i> 审核</a>

                </td>
            </tr>
        </tbody>
    </table>
    <div class="row">
        <div class="col-md-12">
            <uib-pagination total-items="model.total_result" items-per-page="model.size" ng-model="model.page" num-pages="model.total_pages"
                            ng-change="search_page(model.page)" class="pagination-sm" boundary-links="true" boundary-link-numbers="true" max-size="20"
                            previous-text="&lsaquo;" next-text="&rsaquo;" first-text="&laquo;" last-text="&raquo;"></uib-pagination>
            <span class="pull-right" style="margin: 30px 0px 20px 0px">共{{model.total_result}} 当前：{{model.page}}/{{model.total_pages}}</span>
        </div>
    </div>
    <script type="text/ng-template" id="audit_action.html">
        <div class="modal-header">
            <h3 class="modal-title">审核</h3>
        </div>
        <div class="modal-body">
            <form name="_form" class="form-horizontal w5c-form" role="form">
                <div class="form-group">
                    <label class="col-sm-2 control-label">状态</label>
                    <div class="col-sm-8">
                        <div class="col-sm-12">
                            <select name="equota_record_audit" class="form-control input-sm" ng-model="model.equota_record_audit_" required>
                                <option value="">请选择</option>
                                <option value="1">已通过</option>
                                <option value="2">未通过</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" >添加数量</label>
                    <div class="col-sm-10">
                        <input  type="number" name="audit_num" class="form-control input-sm" ng-model="model.audit_num_" required></input>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">备注</label>
                    <div class="col-sm-10">
                        <textarea rows="4" name="remark" class="form-control input-sm" ng-model="model.remark_"></textarea>
                    </div>
                </div>
            </form>
        </div>
        <div class="modal-footer">
            <button class="btn btn-primary" type="button" ng-click="save()">保存</button>
            <button class="btn btn-primary" type="button" ng-click="cancel()">取消</button>
        </div>
    </script>
</div>
